package com.alan.base.ui;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.alan.base.utils.Logger;

public class BaseFragment extends Fragment {

    protected Context mContext;
    protected String TAG = getClass().getSimpleName();
    protected LayoutInflater inflater;
    protected ViewGroup mContainer;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        Logger.v(TAG + " onCreateView");
        this.inflater = inflater;
        this.mContainer = container;
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onStart() {
        super.onStart();
        Logger.v(TAG + " onStart");
    }

    @Override
    public void onResume() {
        super.onResume();
        Logger.v(TAG + " onResume");

    }

    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        Logger.v(TAG + " onAttach");
        mContext = context;
    }

    @Override
    public void onPause() {
        super.onPause();
        Logger.v(TAG + " onPause");
    }

    @Override
    public void onStop() {
        super.onStop();
        Logger.v(TAG + " onStop");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Logger.v(TAG + " onDestroy");
    }

    @Nullable
    @Override
    public Context getContext() {
        return mContext;
    }
}
